<?php
/**
 * Created by PhpStorm.
 * User: 刘红波 <liuhb@cqjcdflzxsws.com>
 * Date: 2018/10/22
 * Time: 15:44
 */

namespace app\api\controller;

use app\api\model\WeUsers as UserModel;

class WeUsers extends Base
{
    public function changeName(){
        $data = $this->request->post();
        $res = $this->validate($data,'app\api\validate\WeUsers.change_name');
        if (true !== $res){
            list($this->code, $this->msg) = [0, $res];
            return;
        }
        $userModel = new UserModel();
        $result = $userModel->changeNickName($data['nick_name'],$this->uid);
        list($this->code,$this->msg) = [$result['code'],$result['msg']];
        return;
    }
}